<script setup lang="ts">
import { computed, onMounted, watch } from '@vue/runtime-core'
const props = defineProps<{ zi: { title: string; isRed: boolean; position: [number, number] } }>()
const style = computed(() => {
  console.log(props.zi.isRed ?? 'color:red')
  return `top:${props.zi.position[0] * 80 - 31}px;left:${props.zi.position[1] * 80 - 31}px;${props.zi.isRed ? 'color:red;' : ''}`
})
// watch(()=>props.zi,()=>{

// })
onMounted(() => {})
</script>
<template>
  <div :style="style" class="Zi">{{ zi.title }}</div>
</template>
<style scoped>
.Zi {
  width: 50px;
  height: 50px;
  border-radius: 50px;
  background: coral;
  text-align: center;
  line-height: 50px;
  font-size: 36px;
  border: rgb(200, 140, 60) double 6px;
  background: rgb(250, 192, 111);
  font-family: '楷体';
  text-shadow: 0px 0px 2px white;
  box-shadow: 2px 2px 2px #333;
  position: absolute;
  font-weight: bold;
  z-index: 6;
  text-shadow: 1px 1px #ddd;
}
</style>
